<template>
	<view class="preset">
		<view
			@click="clickList(item)"
			v-for="item in list"
			class="for">
			{{item}}
		</view>
		<view
			@click="clickList(item)"
			v-for="item in listAll"
			class="for">
			{{item}}
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[],
				listAll:[]
			}
		},
		onLoad() {
			this.get();
		},
		methods: {
			get(){
				uni.getStorage({
					key: 'cachePreset',
					success: (res) => {
						this.list = res.data;
					}
				});
				this.getList();
			},
			getList(){
				uni.request({
					url:this.$_Config() + "Config.json",
					success: (res) => {
						this.listAll = res.data.editor.editor.preset;
					}
				})
			},
			clickList(item){
				uni.$emit('preset',{msg:item})
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss">
.preset{
	padding: 0 25rpx;
	.for{
		box-shadow: 0 0 1rpx $ZhanWeiSe;
		margin: 25rpx 0 0 0;
		background: $BeiJingSe;
		font-size: 28rpx;
		line-height: 40rpx;
		padding: 15rpx;
	}
}
</style>
